home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- main()
- {
- char name[60],outname[60];
- long count,start;
- int ch,lcount;
- FILE *infile,*outfile;
-
- strcpy(name,"quote.dat");
- strcpy(outname,"quote.idx");
- infile = fopen(name,"rb");
- outfile = fopen(outname,"w");
-
- count = 0;
- lcount = 0;
- while((ch = fgetc(infile)) != EOF) {
- count++;
- if (ch == '{') {
- lcount++;
- start = count;
- do count++; while ((ch = fgetc(infile)) != (int) '}');
- fprintf(outfile,"%10ld %10ld\n",start,count);
- }
- }
- fprintf(outfile,"%10d",lcount);
- fclose(infile);
- fclose(outfile);
- }
-
-